package atividade;

import java.util.ArrayList;

import com.example.primeiraaplicacao.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;

public class Registro extends Activity {
	
	EditText nome,email;
	RadioGroup radioGrupo;
	RadioButton radioSexo;
	CheckBox receberEmail;
	Spinner spinnerSites;
	private ArrayList<String> sites=new ArrayList<String>();
	
	public void onCreate(Bundle icicle){
		super.onCreate(icicle);
		setContentView(R.layout.registro);
		
		nome=(EditText)findViewById(R.id.nome);
		email=(EditText)findViewById(R.id.email);
		radioGrupo=(RadioGroup)findViewById(R.id.groupSexo);
		receberEmail=(CheckBox)findViewById(R.id.cbSites);
		spinnerSites=(Spinner)findViewById(R.id.sites);
		
		sites.add("Yahoo");
		sites.add("Hotmail");
		sites.add("Gmail");
		ArrayAdapter<String> adaptador=new ArrayAdapter<String>(this, 
				android.R.layout.simple_spinner_item, sites);
		adaptador.setDropDownViewResource(android.R.layout.simple_spinner_item);
		spinnerSites.setAdapter(adaptador);
	}

	public boolean onCreateOptionsMenu(Menu menu){
		super.onCreateOptionsMenu(menu);
		menu.add(0,0,0,"Salvar");
		menu.add(0,1,0,"Sair");
		return true;
	}
	
	public boolean onMenuItemSelected(int featuredId,MenuItem item){
		switch (item.getItemId()) {
		case 0:
			
			break;

		case 1:
			finish();
			break;
		}
		return false;
	}

}
